﻿<Window x:Class="Mayhem.ModuleList"
		xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
		xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:common="clr-namespace:MayhemWpf.UserControls;assembly=MayhemWpf"
		WindowStyle="None" ResizeMode="NoResize" BorderThickness="2" WindowStartupLocation="CenterOwner" ShowInTaskbar="False" >
    <Grid Name="gridControls">
        <Grid.RenderTransform>
            <TranslateTransform X="0" />
        </Grid.RenderTransform>
        <StackPanel Style="{StaticResource BackgroundGradient}" Name="stackPanelList" Width="300" HorizontalAlignment="Left">
            <StackPanel.RenderTransform>
                <TranslateTransform X="0" />
            </StackPanel.RenderTransform>
            <common:WindowHeader Text="{Binding Text, RelativeSource={RelativeSource AncestorType={x:Type Window}}}" />
            <common:Borders Margin="0,10,0,0">
                <StackPanel>
                    <ListBox Height="360" x:Name="ModulesList" BorderThickness="0"  Margin="2,0,2,0">
                        <ListBox.ItemContainerStyle>
                            <Style TargetType="{x:Type ListBoxItem}" BasedOn="{StaticResource {x:Type ListBoxItem}}">
                                <EventSetter Event="MouseDoubleClick" Handler="ListBoxItem_MouseDoubleClick"/>
                            </Style>
                        </ListBox.ItemContainerStyle>
                        <ListBox.ItemTemplate>
                            <DataTemplate>
                                <Border BorderThickness="0,0,0,1" BorderBrush="#FFD4D4D4">
                                    <StackPanel Orientation="Vertical" Margin="2,3,2,3">
                                        <TextBlock Style="{StaticResource ModuleNameStyle}" TextAlignment="Center" Text="{Binding Name}" />
                                        <StackPanel Orientation="Horizontal">
                                            <TextBlock Text="{Binding Description}" TextAlignment="Center" FontStyle="Italic" TextWrapping="WrapWithOverflow" Width="225" />
                                        </StackPanel>
                                    </StackPanel>
                                </Border>
                            </DataTemplate>
                        </ListBox.ItemTemplate>
                    </ListBox>
                    <StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Margin="0,10,0,5" >
                        <Button Name="buttonChoose" Margin="0,0,10,0" Click="ChooseButtonClick" Height="30" Width="60" IsDefault="True">Choose</Button>
                        <Button Name="buttonCancel" Click="buttonCancel_Click" Height="30" Width="60" IsCancel="True">Cancel</Button>
                    </StackPanel>
                    <TextBlock HorizontalAlignment="Center">
                        <Hyperlink NavigateUri="http://makemayhem.com/Packages/All" RequestNavigate="Hyperlink_RequestNavigate">
                          Get More Packages
                        </Hyperlink>
                    </TextBlock>
                </StackPanel>
            </common:Borders>
        </StackPanel>
        <StackPanel Style="{StaticResource BackgroundGradient}" Name="stackPanelConfig" Visibility="Hidden">
            <StackPanel.RenderTransform>
                <TranslateTransform X="300" />
            </StackPanel.RenderTransform>
            <common:WindowHeader Name="windowHeaderConfig" />
            <common:Borders Margin="0,10,0,0">
                <StackPanel>
                    <ContentPresenter Name="ConfigContent">
                    </ContentPresenter>
                    <StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Margin="0,10,0,0">
                        <Button Name="buttonSave" Click="buttonSave_Click" Height="30" Width="50">Save</Button>
                        <Button Name="buttonConfigCancel" Click="buttonConfigCancel_Click" Height="30" Width="50">Cancel</Button>
                    </StackPanel>
                </StackPanel>
            </common:Borders>
        </StackPanel>
    </Grid>
</Window>
